<!--
 * @Author: 叫我龟先生 yyxxkahhh@163.com
 * @Date: 2022-11-09 21:07:12
 * @LastEditors: 叫我龟先生 yyxxkahhh@163.com
 * @LastEditTime: 2022-11-14 15:35:52
 * @FilePath: \lanxiangdkk\src\module-manage\pages\logs.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<div class="main">
  <el-card class="page-tools">
    <el-row type="flex" justify="space-between" align="middle">
      <el-col>
        <div class="before info">
          <i class="el-icon-info" />
          <span>共25条记录</span>
        </div>
      </el-col>
    </el-row>
    <el-table class="table" :data="dataList" >
    <el-table-column label="操作类型" prop="type" align="center" />
    <el-table-column label="操作人" prop="author" align="center" />
    <el-table-column label="执行结果" prop="title" align="center" />
    <el-table-column label="操作时间" prop="display_time" align="center" />
  </el-table>
  <pageTool
  style="margin-left:900px"
  @pageChange="pageChange"
  :total= "counts"
  :paginationPage = "requestData.page"
  :paginationPagesize= "requestData.pagesize"
  ></pageTool>
  </el-card>
</div>
</template>

<script>
import { list } from '@/api/example/table'
import pageTool from '@/module-manage/components/page-tool.vue'
export default {
  components: {
    pageTool
  },
  data () {
    return {
      dataList: [],
      counts: '',
      requestData: {
        page: 1,
        pagesize: 1
      }
    }
  },
  created () {
    this.listdata()
  },
  methods: {
    async listdata () {
      const res = await list(this.dataList)
      // console.log(res)
      this.dataList = res.data.items
    },
    pageChange (page) {
      // console.log(page)
      this.requestData.page = page
      this.listTable()
    }
  }
}
</script>

<style lang='scss'>
.main{
  margin: 20px;
   .page-tools {
    margin: 10px 0;
    .before {
      line-height: 34px;
      display: inline-block;
      border-radius: 3px;
      i {
        margin-right: 5px;
      }
      &.info {
        padding: 0px 10px;
        width: 1275px;
        background: #f4f4f5;
        color: #909399;
        font-size: 15px;
        i {
          color: #909399;
        }
      }
  }
 }
}

</style>
